<%@page import="com.javandad.app.server.UserManager" %>
<%@page import="com.javandad.app.shared.entity.User"%>
<%@page import="com.javandad.app.server.db.DatabaseManager"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="com.javandad.app.server.db.PMFSingleton"%>

                        <%
                        PersistenceManager pm = PMFSingleton.getPM();
                     	User view = DatabaseManager.getDefaultDatabaseManager().getUser(request.getParameter("view"),pm);
                        User user = (User) session.getAttribute("user");
                        String codesvrParam = (String) request.getParameter("codesvrParam");
                        if (view == null )
                        	view = user;
                  
                        %>
                        
						

<table align="right" style="text-align:right;">
							<tr style="text-align:right;">
								<td align="right" style="text-align:right;">
								<table align="right" style="text-align:right;" >
									<tr>
									<%
										if ( user != null) {
									%>
									
									    
										<td style="vertical-align:middle;" >
											<a href="home.jsp?<%=codesvrParam%>" >Home</a>
											<a href="messagebox.jsp?<%=codesvrParam%>">Message Box</a>
											<a href="resume.jsp?<%=codesvrParam%>">Resume</a>
											<a href="fodos.jsp?<%=codesvrParam%>">Photos &amp; Document Scans</a>
											<a href="projects.jsp?<%=codesvrParam%>">Projects</a>
											<a href="network.jsp?<%=codesvrParam%>">Friends &amp; Groups</a>
										</td>
										
										<td style="vertical-align:middle; white-space:nowrap;">
                                    		<%
                                    			String logoutHref = UserManager.getLogoutURL("/login.jsp?"+codesvrParam);
                                    		%>
                                    		<a href="<%= logoutHref %>">logout</a>
										</td>
                                    <%
                                    	} else {
                                    %>
                                    	<td colspan=2 style="text-aling:right; vertical-align:middle; white-space:nowrap;">
                                    		<%
                                    			String loginHref = UserManager.getLoginURL(UserManager.openIdUrl, "/login.jsp?"+codesvrParam);
                                    		%>
                                    	                                    		<a href="<%= loginHref %>">login</a>
                                    	</td>
                                    	
                                    <% } %>
                                    
                                    </tr>
								</table>
								</td>
							</tr>
						</table>